package com.zg.scf.domain.req.product;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zg.common.core.req.EditReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * DESCRIPTION
 *
 * @author zhanfeng.liang
 * @since 2025-07-22
 */

@Data
@ApiModel(value = "产品EditReq",description = "产品修改请求")
public class ProductEditReq extends EditReq {
    @ApiModelProperty(value = "授信名称", required = true)
    @NotNull(message = "授信名称不能为空")
    private  Long creditId;

    @ApiModelProperty(value = "产品编号", required = true)
    @NotEmpty(message = "产品编号不能为空")
    @Length(max = 50, message = "产品编号长度不能超过50")
    private String productCode;

    @ApiModelProperty(value = "金融机构", required = true)
    @NotNull(message = "金融机构不能为空")
    private Long bankId;

    @ApiModelProperty(value = "产品有效期开始", required = true)
    @NotNull(message = "产品有效期开始不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date productBegin;

    @ApiModelProperty(value = "产品有效期结束", required = true)
    @NotNull(message = "产品有效期结束不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date productEnd;

    @ApiModelProperty(value = "产品利率类型", required = true, example = "年利率")
    @NotEmpty(message = "产品利率类型不能为空")
    @Length(max = 20, message = "产品利率类型长度不能超过20")
    private String interestRateType;

    @ApiModelProperty(value = "贷款时限类型", required = true, example = "年")
    @NotEmpty(message = "贷款时限类型不能为空")
    @Length(max = 20, message = "贷款时限类型长度不能超过20")
    private String loanTermType;

    @ApiModelProperty(value = "还款方式", required = true, example = "等额本息,按月付息到期还本")
    @NotEmpty(message = "还款方式不能为空")
    @Length(max = 200, message = "还款方式长度不能超过200")
    private String repaymentMethod;

    @ApiModelProperty(value = "放款账户", required = true)
    @NotEmpty(message = "放款账户不能为空")
    @Length(max = 200, message = "放款账户长度不能超过200")
    private String disbursementAccount;

    @ApiModelProperty(value = "逾期利息下限（%）", required = true, example = "0.05")
    @NotNull(message = "逾期利息下限不能为空")
    @DecimalMin(value = "0.0", message = "逾期利息下限不能小于0")
    private BigDecimal overdueInterestLow;

    @ApiModelProperty(value = "逾期利息上限（%）", required = true, example = "0.1")
    @NotNull(message = "逾期利息上限不能为空")
    @DecimalMin(value = "0.0", message = "逾期利息上限不能小于0")
    @DecimalMax(value = "100.0", message = "逾期利息上限不能超过100")
    private BigDecimal overdueInterestHigh;

    @ApiModelProperty(value = "汇票开立", required = true, example = "电子汇票")
    @NotEmpty(message = "汇票开立不能为空")
    @Length(max = 200, message = "汇票开立长度不能超过200")
    private String billType;

    @ApiModelProperty(value = "产品描述", example = "本产品适用于...")
    @Length(max = 2000, message = "产品描述长度不能超过2000")
    private String description;

    @ApiModelProperty(value = "产品特色", example = "低利率、高额度...")
    @Length(max = 2000, message = "产品特色长度不能超过2000")
    private String features;

    @ApiModelProperty(value = "产品来源", example = "内部研发")
    @Length(max = 2000, message = "产品来源长度不能超过2000")
    private String source;

    @ApiModelProperty(value = "返佣情况", example = "按贷款金额的1%返佣")
    @Length(max = 2000, message = "返佣情况长度不能超过2000")
    private String commissionInfo;

    @ApiModelProperty(value = "保证金情况", example = "需缴纳10%保证金")
    @Length(max = 2000, message = "保证金情况长度不能超过2000")
    private String depositInfo;

    @ApiModelProperty(value = "兜底情况", example = "由母公司担保")
    @Length(max = 2000, message = "兜底情况长度不能超过2000")
    private String guaranteeInfo;

    @ApiModelProperty(value = "适用客户", example = "中小企业")
    @Length(max = 2000, message = "适用客户长度不能超过2000")
    private String applicableCustomers;

    @ApiModelProperty(value = "申请条件", example = "年营业额不低于500万")
    @Length(max = 2000, message = "申请条件长度不能超过2000")
    private String applicationConditions;

    @ApiModelProperty(value = "提交材料", example = "营业执照、财务报表...")
    @Length(max = 2000, message = "提交材料长度不能超过2000")
    private String submitMaterials;

    @ApiModelProperty(value = "申请流程", example = "初审->复审->终审")
    @Length(max = 2000, message = "申请流程长度不能超过2000")
    private String applicationProcess;

    @ApiModelProperty(value = "授信模式", required = true, example = "产品授信")
    @NotEmpty(message = "授信模式不能为空")
    @Length(max = 50, message = "授信模式长度不能超过50")
    private String creditMode;

    @ApiModelProperty(value = "产品名称", required = true)
    @NotEmpty(message = "产品名称不能为空")
    @Length(max = 200, message = "产品名称长度不能超过200")
    private String productName;

    @ApiModelProperty(value = "产品流程", required = true, example = "初审->复审->终审")
    @NotEmpty(message = "产品流程不能为空")
    @Length(max = 200, message = "产品流程长度不能超过200")
    private String productProcess;

    @ApiModelProperty(value = "产品额度下限（万元）", required = true, example = "50.0")
    @NotNull(message = "产品额度下限不能为空")
    @DecimalMin(value = "0.0", message = "产品额度下限不能小于0")
    private BigDecimal amountLow;

    @ApiModelProperty(value = "产品额度上限（万元）", required = true, example = "500.0")
    @NotNull(message = "产品额度上限不能为空")
    @DecimalMin(value = "0.0", message = "产品额度上限不能小于0")
    private BigDecimal amountHigh;

    @ApiModelProperty(value = "产品利率下限（%）", required = true, example = "3.5")
    @NotNull(message = "产品利率下限不能为空")
    @DecimalMin(value = "0.0", message = "产品利率下限不能小于0")
    private BigDecimal interestLow;

    @ApiModelProperty(value = "产品利率上限（%）", required = true, example = "6.0")
    @NotNull(message = "产品利率上限不能为空")
    @DecimalMin(value = "0.0", message = "产品利率上限不能小于0")
    private BigDecimal interestHigh;

    @ApiModelProperty(value = "贷款时限下限（年）", required = true, example = "1")
    @NotNull(message = "贷款时限下限不能为空")
    @Min(value = 1, message = "贷款时限下限不能小于1")
    private Integer loanTermLow;

    @ApiModelProperty(value = "贷款时限上限（年）", required = true, example = "5")
    @NotNull(message = "贷款时限上限不能为空")
    @Min(value = 1, message = "贷款时限上限不能小于1")
    private Integer loanTermHigh;

    @ApiModelProperty(value = "还款结果", required = true, example = "手动录入还款数据")
    @NotEmpty(message = "还款结果不能为空")
    @Length(max = 200, message = "还款结果长度不能超过200")
    private String repaymentResult;

    @ApiModelProperty(value = "放款审批时间", required = true)
    @NotNull(message = "放款审批时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date disbursementApprovalDate;

    @ApiModelProperty(value = "贴现利率下限（%）", example = "0.03")
    @DecimalMin(value = "0.0", message = "贴现利率下限不能小于0")
    private BigDecimal discountInterestLow;

    @ApiModelProperty(value = "贴现利率上限（%）", example = "0.05")
    @DecimalMin(value = "0.0", message = "贴现利率上限不能小于0")
    private BigDecimal discountInterestHigh;

    @ApiModelProperty(value = "汇票交付", example = "电子签收")
    @Length(max = 200, message = "汇票交付长度不能超过200")
    private String billDelivery;
}
